package com.ak.assets;

import com.ak.cluster.AssetIndex;
import com.ak.cluster.GameObject;
import com.ak.cluster.GameWorld;


public class Sky extends GameObject{
	int time;
	boolean isRising;
	boolean isSetting;
	public GameWorld mWorld;

	
	
	public Sky(GameWorld world)
	{
		
		super();
		mWorld = world;
		textureID = 1;
		//Load your texture into the Assets folder in the Android project folder,
		//Then update
		//Then add the texture into the AssetIndex
		isRising = true;
		isSetting = false;
		time = 1;
		position.x = 0;
		position.y = 0;
		scale.x = 50;
		scale.y = 50;
		chosenBodyType = 3;
		assetTexture = assignTexture(AssetIndex.skyTexture);
		chosenRenderSetting = RenderOptions.SOLID.code;
		assetMesh = buildMesh(assetMesh, assetTexture);
		world.addObject(this);
	}
	@Override
	public void update()
	{
//		 if(time>=4096 && isRising == true)
//		 {
//			 isSetting = true;
//			 isRising = false;
//		 }
//		 if(time<=-4096 && isSetting == true)
//		 {
//			 isSetting = false;
//			 isRising = true;
//		 }
		 if(time >= 0 && isRising == true)
			 time++;
		 if(time <= -4096 && isSetting == true)
			 time--;	 
	}
	@Override
	protected void dispose() {
		// TODO Auto-generated method stub
		assetTexture.dispose();
		assetMesh.dispose();
	}
}
